package com.tyqx.hashchainbackend.controller;

import com.tyqx.hashchainbackend.service.TrackDonateService;
import com.tyqx.hashchainbean.module.*;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/trackDonate")
@CrossOrigin
public class TrackDonateController {

    @Resource
    private TrackDonateService trackDonateService;

    //捐赠物资
    public Integer donateProduct(DonateProduct donateProduct) throws Exception {
        return trackDonateService.donateProduct(donateProduct);
    }

    //捐款
    public Integer donateCash(DonateCash donateCash) throws Exception {
        return trackDonateService.donateCash(donateCash);
    }

    //捐赠物资入库
    public Integer productIn(ProductIn productIn) throws Exception {
        return trackDonateService.productIn(productIn);
    }

    //捐赠物资出库
    public Integer productOut(ProductOut productOut) throws Exception {
        return trackDonateService.productOut(productOut);
    }

    //领用物资
    public Integer useProduct(UseProduct useProduct) throws Exception {
        return trackDonateService.useProduct(useProduct);
    }

    //需求物资发布
    public Integer needProduct(NeedProduct needProduct) throws Exception {
        return trackDonateService.needProduct(needProduct);
    }

    //采购物资
    public Integer buyProduct(BuyProduct buyProduct) throws Exception {
        return trackDonateService.buyProduct(buyProduct);
    }

    //生产物资计划发布
    public Integer producePlan(ProducePlan producePlan) throws Exception {
        return trackDonateService.producePlan(producePlan);
    }

    //产成品入库
    public Integer produceProductIn(ProduceProductIn produceProductIn) throws Exception {
        return trackDonateService.produceProductIn(produceProductIn);
    }

    //销售出库
    public Integer produceProductOut(ProduceProductOut produceProductOut) throws Exception {
        return trackDonateService.produceProductOut(produceProductOut);
    }

    //运送物资出库
    public Integer shippingProduct(ShippingInfo shippingInfo) throws Exception {
        return trackDonateService.shippingProduct(shippingInfo);
    }
}
